//
//  ViewController.m
//  countdownDemo
//
//  Created by wanglei on 17/3/8.
//  Copyright © 2017年 wanglei. All rights reserved.
//

#import "ViewController.h"
#import "CountDownViewController.h"



static NSString *identifer = @"cell";
@interface ViewController ()<UITabBarDelegate,UITableViewDataSource>
@property (weak, nonatomic) IBOutlet UITableView *table;

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.navigationItem.title = @"倒计时演示";
    self.table.tableHeaderView = [[UIView alloc]initWithFrame:CGRectZero];
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    return 2;
}


- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:identifer];
    if (cell == nil) {
        cell = [[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:identifer];
    }
    if (indexPath.item == 0) {
        cell.textLabel.text = @"单独的计时器";
    }else{
        cell.textLabel.text = @"cell中的倒计时";
    }
    return cell;
}


-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
    [tableView deselectRowAtIndexPath:indexPath animated:YES];
    
    if (indexPath.row==0) {
        [self.navigationController pushViewController:[CountDownViewController new] animated:YES];
    }else{
       // [self.navigationController pushViewController:[CountDownInCellViewController new] animated:YES];
    }
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}


@end
